FROM docker.esf.fangdd.net/fdd-ci:latest as builder
WORKDIR /app
COPY package.json .
COPY package-lock.json .
COPY angular.json .
RUN npm install -g @angular/cli && npm i
RUN mkdir -p dist
COPY . .
RUN pwd && ls -ltr && ng build --prod --build-optimizer

FROM nginx
COPY --from=builder /app/dist /usr/share/nginx/html
COPY --from=builder /app/default.conf /etc/nginx/conf.d/default.conf
